<template>
    <el-row class="tac">
        <el-col :span="24">
            <el-menu default-active="2"  @open="handleOpen" @close="handleClose">
                <el-sub-menu index="1">
                    <template #title>
                        <el-icon>
                            <location />
                        </el-icon>
                        <span>首页</span>
                    </template>
                    <el-menu-item-group title="轮播图管理">
                        <el-menu-item index="1-1">
                            <router-link to="/layout/banner_add"><span>发布轮播图</span></router-link>
                        </el-menu-item>
                        <el-menu-item index="1-2">
                            <router-link to="/layout/banner_list"><span>轮播图列表</span></router-link>
                        </el-menu-item>
                    </el-menu-item-group>
                    <el-menu-item-group title="导航管理">
                        <el-menu-item index="1-3">
                            <router-link to="/layout/navi_add"><span>添加导航</span></router-link>
                        </el-menu-item>
                        <el-menu-item index="1-4">
                            <router-link to="/layout/navi_list"><span>导航列表</span></router-link>
                        </el-menu-item>
                    </el-menu-item-group>
                </el-sub-menu>

                <el-menu-item index="2">
                    <el-icon><icon-menu /></el-icon>
                    <router-link to="/layout/papers"><span>旅游文章管理</span></router-link>
                </el-menu-item>

                <el-menu-item index="3">
                    <el-icon>
                        <document />
                    </el-icon>
                    <router-link to="/layout/user_list"><span>用户管理</span></router-link>
                </el-menu-item>

                <el-menu-item index="4">
                    <el-icon>
                        <setting />
                    </el-icon>
                    <router-link to="/layout/setting"><span>系统设置</span></router-link>
                </el-menu-item>
            </el-menu>
        </el-col>
    </el-row>
</template>

<script lang="ts" setup>
import {
    Document,
    Menu as IconMenu,
    Location,
    Setting,
} from '@element-plus/icons-vue'
const handleOpen = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
</script>